module.exports = {
    name: "PageVisit",
    viewName: 'PageVisit',
    primaryKey: "Id",
    properties: getProperties(),
    pagesDataSource: getPagesDataSource(),
    timeTypeDataSource: getTimeTypeDataSource()
}

function getProperties() {
    return [
        getProperty("Id", "Id"),
        getProperty("TimePoint", "时间点"),
        getProperty("VisitCount", "浏览量(PV)"),
        getProperty("UserVisitCount", "访客量(UV)"),
        getProperty("AvgVisitTime", "平均访问时长")
    ]
}

function getProperty(name, label) { return { name, label } }

function getPagesDataSource() {
    return {
        valueName: "PageId",
        textName: "Name",
        stateName: "getPages",
        serviceName: "PageVisitService",
        actionName: "getPages"
    }
}

function getTimeTypeDataSource() {
    return [{ value: 1, text: "半小时" }, { value: 2, text: "一小时" }, { value: 3, text: "一天" }]
}